<template>
  <div>
    <van-sticky>
      <div class="metroHeader">
        <van-icon name="arrow-left" @click="back" class="backIcon" />
        <h1>{{ headTitle }}</h1>
        <div></div>
      </div>
    </van-sticky>
  </div>
</template>

<script>
export default {
  props: ["headTitle"],
  methods: {
    back() {
      this.$router.go(-1);
    },
  },
};
</script>

<style lang="scss" scoped>
.metroHeader {
  background-color: skyblue;
  height: 45px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  .backIcon {
    color: #fff;
    font-size: 20px;
  }
  h1 {
    font-size: 20px;
    margin-right: 20px;
    color: #fff;
  }
}
</style>